package com.hzw.saas.common.storage.rsync;

import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 文件同步中，文件差异对比后的分块数据
 *
 * @author zzl
 * @since 06/22/2021
 */
@Data
@EqualsAndHashCode(callSuper = false)
public class DiffBlock extends BaseBlock {

    private static final long serialVersionUID = 1L;

    /**
     * 分片ID，用于isOrigin==0时
     */
    private String blockId;

    /**
     * 是否为旧文件分片块,0-否，1-是
     */
    protected Integer isOrigin;

    public DiffBlock(Long pos, Integer length, Integer isOrigin, String blockId) {
        super(pos, length);
        this.blockId = blockId;
        this.isOrigin = isOrigin;
    }
}
